/**
 */
package proyecto.testcasetool.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

import proyecto.testcasetool.StringRange;
import proyecto.testcasetool.TestcasetoolPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>String Range</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link proyecto.testcasetool.impl.StringRangeImpl#isNull <em>Is Null</em>}</li>
 *   <li>{@link proyecto.testcasetool.impl.StringRangeImpl#isEmpty <em>Is Empty</em>}</li>
 *   <li>{@link proyecto.testcasetool.impl.StringRangeImpl#getValue <em>Value</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class StringRangeImpl extends ParameterRangeImpl implements StringRange {
	/**
	 * The default value of the '{@link #isNull() <em>Is Null</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isNull()
	 * @generated
	 * @ordered
	 */
	protected static final boolean IS_NULL_EDEFAULT = false;

	/**
	 * The cached value of the '{@link #isNull() <em>Is Null</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isNull()
	 * @generated
	 * @ordered
	 */
	protected boolean isNull = IS_NULL_EDEFAULT;

	/**
	 * The default value of the '{@link #isEmpty() <em>Is Empty</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isEmpty()
	 * @generated
	 * @ordered
	 */
	protected static final boolean IS_EMPTY_EDEFAULT = false;

	/**
	 * The cached value of the '{@link #isEmpty() <em>Is Empty</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #isEmpty()
	 * @generated
	 * @ordered
	 */
	protected boolean isEmpty = IS_EMPTY_EDEFAULT;

	/**
	 * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getValue()
	 * @generated
	 * @ordered
	 */
	protected static final String VALUE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getValue()
	 * @generated
	 * @ordered
	 */
	protected String value = VALUE_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected StringRangeImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return TestcasetoolPackage.Literals.STRING_RANGE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isNull() {
		return isNull;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setIsNull(boolean newIsNull) {
		boolean oldIsNull = isNull;
		isNull = newIsNull;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TestcasetoolPackage.STRING_RANGE__IS_NULL, oldIsNull, isNull));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isEmpty() {
		return isEmpty;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setIsEmpty(boolean newIsEmpty) {
		boolean oldIsEmpty = isEmpty;
		isEmpty = newIsEmpty;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TestcasetoolPackage.STRING_RANGE__IS_EMPTY, oldIsEmpty, isEmpty));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getValue() {
		return value;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setValue(String newValue) {
		String oldValue = value;
		value = newValue;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, TestcasetoolPackage.STRING_RANGE__VALUE, oldValue, value));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case TestcasetoolPackage.STRING_RANGE__IS_NULL:
				return isNull();
			case TestcasetoolPackage.STRING_RANGE__IS_EMPTY:
				return isEmpty();
			case TestcasetoolPackage.STRING_RANGE__VALUE:
				return getValue();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case TestcasetoolPackage.STRING_RANGE__IS_NULL:
				setIsNull((Boolean)newValue);
				return;
			case TestcasetoolPackage.STRING_RANGE__IS_EMPTY:
				setIsEmpty((Boolean)newValue);
				return;
			case TestcasetoolPackage.STRING_RANGE__VALUE:
				setValue((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case TestcasetoolPackage.STRING_RANGE__IS_NULL:
				setIsNull(IS_NULL_EDEFAULT);
				return;
			case TestcasetoolPackage.STRING_RANGE__IS_EMPTY:
				setIsEmpty(IS_EMPTY_EDEFAULT);
				return;
			case TestcasetoolPackage.STRING_RANGE__VALUE:
				setValue(VALUE_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case TestcasetoolPackage.STRING_RANGE__IS_NULL:
				return isNull != IS_NULL_EDEFAULT;
			case TestcasetoolPackage.STRING_RANGE__IS_EMPTY:
				return isEmpty != IS_EMPTY_EDEFAULT;
			case TestcasetoolPackage.STRING_RANGE__VALUE:
				return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (isNull: ");
		result.append(isNull);
		result.append(", isEmpty: ");
		result.append(isEmpty);
		result.append(", value: ");
		result.append(value);
		result.append(')');
		return result.toString();
	}

} //StringRangeImpl
